package com.yq.light.blog.code.service.impl;

import com.yq.light.blog.code.dao.BlogDao;
import com.yq.light.blog.code.service.BlogService;
import com.yq.light.commons.code.entity.Bolog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("blogService")
@Transactional
@Slf4j
public class BlogServiceImpl implements BlogService {

    @Autowired
    private BlogDao blogDao;
    /**
     * select博客列表
     *
     * @param ownerAccount
     * @return
     */
    @Override
    public List<Bolog> blogList(String ownerAccount) {
        List<Bolog> list = blogDao.blogList(ownerAccount);
        return list;
    }

    /**
     * 新建博客
     *
     * @param bolog
     * @return
     */
    @Override
    public int newBlog(Bolog bolog) {
        int result = 0;
        result = blogDao.newBlog(bolog);
        return result;
    }
}
